// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.

namespace SixLabors.ImageSharp.Processing;

/// <summary>
/// Defines extensions that allow the application of rotate-flip operations on an <see cref="Image"/>
/// using Mutate/Clone.
/// </summary>
public static class RotateFlipExtensions
{
    /// <summary>
    /// Rotates and flips an image by the given instructions.
    /// </summary>
    /// <param name="source">The current image processing context.</param>
    /// <param name="rotateMode">The <see cref="RotateMode"/> to perform the rotation.</param>
    /// <param name="flipMode">The <see cref="FlipMode"/> to perform the flip.</param>
    /// <returns>The <see cref="IImageProcessingContext"/>.</returns>
    public static IImageProcessingContext RotateFlip(this IImageProcessingContext source, RotateMode rotateMode, FlipMode flipMode)
        => source.Rotate(rotateMode).Flip(flipMode);
}
